package com.hotel.services.impl;

import com.hotel.daos.CheckinMapper;
import com.hotel.entitys.Checkin;
import com.hotel.services.CheckinService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.sql.Timestamp;
import java.util.Date;

@Service
@Transactional
public class CheckinServiceImpl implements CheckinService {

    @Autowired
    private CheckinMapper checkinMapper;

    @Override
    public int addCheckin(Checkin checkin) {
        return checkinMapper.addCheckin(checkin);
    }

    @Override
    public Checkin getChechin(Integer room_id) {
        return checkinMapper.selectCh(room_id);
    }

    @Override
    public int getUpdate(Checkin checkin) {
        System.out.println(checkin+"88888888");
        return checkinMapper.updateCh(checkin);
    }

    @Override
    public Checkin selAllCheckin(Integer room_id) {
        return checkinMapper.selAllCheckin(room_id);
    }

    @Override
    public Double selSum(Checkin checkin) {
        return checkinMapper.selSum(checkin);
    }
}
